In most cases a Velocity or Jelly script is enough, and you can use the
built-in <velocity> or <jelly> plugins.
However, if you need to provide special logic to your templates, you should
subclass one of the base plugin classes and implement this special logic
there. See the
Custom Plugins
section
in the developer documentation for more information.